home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 050 / bix02.arc / PRINTSCR.PAS < prev    next >
Pascal/Delphi Source File  |  1986-08-04  |  2KB  |  70 lines

  1. {enable/disable Shift-PrtSc from Turbo}
  2. { 851022 pavel. Derived from TurboPascal 3.0 DOSFCALL.DOC
  3.                 and the users of BIX.
  4.   Compiled with PC-DOS TurboPascal ver 3.01A
  5.            on an IBM-PC, DOS 2.1
  6.   NOTE: If compiling to a .COM file, set all min/max code/data/stack
  7.         segments to a low value, such as 200, to prevent reloading
  8.         of command.com !
  9. }
  10.  
  11.  
  12. PROGRAM PrintScr;
  13. {
  14.     Enables/disables SHIFT-PRINTSCREEN by setting DOS vector 5
  15.     to point to dummy IRET instruction at $F000:$FF53.
  16.     Uses standard DOS setvec ($25) call.
  17. }
  18.  
  19. VAR
  20.     ch : Char;
  21.  
  22. PROCEDURE SetVector( Vector, AddressHi, AddressLo : Integer);
  23. TYPE
  24.         RegPack = RECORD
  25.         ax,bx,cx,dx,bp,si,di,ds,es,flags: Integer;
  26.         END;
  27.  
  28. VAR
  29.     RecPack:       RegPack;                {record for MsDos call}
  30.  
  31. BEGIN
  32.         WITH RecPack DO
  33.         BEGIN
  34.         ax := $25 shl 8;    { DOS "Set Interrupt Vector" routine}
  35.         ax := ax + Vector;
  36.         ds := AddressHi;
  37.         dx := AddressLo;
  38.         END;
  39.     MsDos(recpack);                        { call function }
  40. END;
  41.  
  42. PROCEDURE EnablePrintScr;
  43. BEGIN
  44.     SetVector( 5, -4096, -172);   { address of print-screen }
  45. END;
  46.  
  47. PROCEDURE DisablePrintScr;
  48. BEGIN
  49.     SetVector( 5, $F000, $FF53);  { address of dummy return }
  50. END;
  51.  
  52. BEGIN { MAIN }
  53.         REPEAT
  54.         WriteLn(' Enter:  E(nable  /  D(isable  print-screen  Q(uit');
  55.         Read( KBD, ch);
  56.         IF ch in ['e','E']
  57.             THEN
  58.             BEGIN
  59.             EnablePrintScr;
  60.             WriteLn(' Shift-PrintScreen is ENabled');
  61.             END
  62.         ELSE IF ch in ['d','D']
  63.             THEN
  64.             BEGIN
  65.             DisablePrintScr;
  66.             WriteLn(' Shift-PrintScreen is DISabled');
  67.             END;
  68.         UNTIL ch in ['q','Q'];
  69. END.
  70.